<template>
	<view class="p-10">
		<view class="card">
			<u-cell-group>
				<u-cell :title="item.title" :value="options[item.prop]" v-for="(item, index) in data" :key="index"></u-cell>
			</u-cell-group>
		</view>
	</view>
</template>
<script setup>
import { onLoad } from '@dcloudio/uni-app';
import { ref } from 'vue';
import { getViolationInfo } from '@/api/hidden-danger.js';

let options = ref({}),
	data = ref([
		{
			title: '三违信息描述',
			prop: 'vioFactDesc'
		},
		{
			title: '违章地点',
			prop: 'riskLocationName'
		},
		{
			title: '违章单位',
			prop: 'vioDeptName'
		},
		{
			title: '违章人员',
			prop: 'vioUserName'
		},
		{
			title: '违章时间',
			prop: 'vioDate'
		},
		{
			title: '不安全行为等级',
			prop: 'vioLevelName'
		},
		{
			title: '不安全行为类别',
			prop: 'vioTypeName'
		},
		{
			title: '查处单位',
			prop: 'findDeptName'
		},
		{
			title: '发现人',
			prop: 'stopUserName'
		},
		{
			title: '罚款(元)',
			prop: 'vioFineMoney'
		},
		{
			title: '主要原因',
			prop: 'mainReason'
		},
		{
			title: '处理结果',
			prop: 'threatResult'
		}
	]);

onLoad((e) => {
	getViolationInfo({
		id: JSON.parse(e.data)?.id
	}).then((res) => {
		options.value = res.data;
	});
});
</script>
<style scoped>
:deep(.u-cell__title) {
	width: 180rpx !important;
}
</style>
